<template>
  <div class="container">
    <div class="title">热销推荐</div>
    <ul class="list">
      <router-link tag="li" :to="`/detail/${item.id}`" class="item border-bottom" v-for="item of recommendList" :key="item.id">
        <img class="img" :src="item.imgUrl" />
        <div class="info">
          <p class="info-title">{{item.title}}</p>
          <p class="info-desc">{{item.desc}}</p>
          <button class="info-btn">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    recommendList: Array
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/varibles.styl'
  @import '~styles/mixins.styl'
  .container
    margin-top .2rem
    background-color #fff
    .title
      font-size .32rem
      color #212121
      width 100%
      height .44rem
      line-height .44rem
      padding .24rem 0 .1rem .2rem
      ellipsis()
    .list
      .item
        padding .2rem
        display flex
        flex-direction row
        .img
          width 1.5rem
          height 1.5rem
        .info
          padding-left .22rem
          flex 1
          min-width 0
          .info-title
            font-size .32rem
            color #212121
            height .56rem
            line-height .56rem
            ellipsis()
          .info-desc
            font-size .3rem
            color #ccc
            ellipsis()
          .info-btn
            font-size .28rem
            padding 0 .14rem
            height .46rem
            line-height .46rem
            color #ffffff
            background-color #ff9300
            border-radius .05rem
            margin-top .14rem
</style>
